<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>导入结果</title>
    <link href="/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <div class="container mt-5">
        <div class="row">
            <div class="col-md-8 offset-md-2">
                <div class="card">
                    <div class="card-header">
                        <h3 class="card-title">导入结果</h3>
                    </div>
                    <div class="card-body">
                        <!-- 导入统计信息 -->
                        <div class="row mb-4">
                            <div class="col-md-4">
                                <div class="card bg-primary text-white">
                                    <div class="card-body">
                                        <h5 class="card-title">总文件数</h5>
                                        <p class="card-text display-6" th:text="${result.totalCount}">0</p>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="card bg-success text-white">
                                    <div class="card-body">
                                        <h5 class="card-title">成功导入</h5>
                                        <p class="card-text display-6" th:text="${result.successCount}">0</p>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-4">
                                <div class="card bg-danger text-white">
                                    <div class="card-body">
                                        <h5 class="card-title">导入失败</h5>
                                        <p class="card-text display-6" th:text="${result.failureCount}">0</p>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <!-- 成功导入的文件列表 -->
                        <div class="mb-4" th:if="${!result.successFiles.empty}">
                            <h4>成功导入的文件</h4>
                            <ul class="list-group">
                                <li class="list-group-item" th:each="file : ${result.successFiles}">
                                    <i class="bi bi-check-circle-fill text-success"></i>
                                    <span th:text="${file}"></span>
                                </li>
                            </ul>
                        </div>

                        <!-- 错误信息列表 -->
                        <div class="mb-4" th:if="${!result.errors.empty}">
                            <h4>导入错误</h4>
                            <div class="alert alert-danger">
                                <ul class="mb-0">
                                    <li th:each="error : ${result.errors}" th:text="${error}"></li>
                                </ul>
                            </div>
                        </div>

                        <!-- 操作按钮 -->
                        <div class="d-grid gap-2">
                            <a href="/import" class="btn btn-primary">继续导入</a>
                            <a href="/" class="btn btn-secondary">返回首页</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <script src="/assets/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>